package main

import (
	"2024_2_9_Go_Learn/unit1/demo1"
	"fmt"
)

func TestDoUse(douse demo1.Use) {
	douse.DoUse()
}

func TestDoUse2(douse interface{ DoUse() }) {
	douse.DoUse()
}

func main() {
	newWeapon := &demo1.Weapon{}
	newAnimal := &demo1.Animal{}
	newWeapon.DoUse()
	newAnimal.DoUse()

	fmt.Println("---------------------------------")

	TestDoUse(newWeapon)
	TestDoUse(newAnimal)

	fmt.Println("---------------------------------")

	TestDoUse2(newWeapon)
	TestDoUse2(newAnimal)
}
